package com.zrrd.mapper;

import com.zrrd.pojo.Course;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title CourseMapper
 * @description
 * @create 2024/1/24 15:50
 */
public interface CourseMapper {

    /**
     * 根据学生id查询查询所选的课程信息
     * @param sId
     * @return
     */
    @Select("SELECT c.id,c.name FROM jms2301_db02.stu_cr sc,jms2301_db02.course c " +
            "WHERE sc.cid=c.id AND sc.sid=#{stuId}")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name")
    })
    List<Course> selectByStuId(Integer sId);
}
